import React, { Component } from 'react'
import ReactDOM from 'react-dom'
// 路由有 hash browser 俩种
import { BrowserRouter as Router, Route, Link, Redirect, Switch } from 'react-router-dom'

import Home from './pages/Home'
import Profile from './pages/Profile'
import User from './pages/User'

import App from './pages/App'

import 'bootstrap/dist/css/bootstrap.css'

/**
 * Router只能有一个子元素
 * exact 严格匹配
 * Redirect 重定向
 */
ReactDOM.render(<Router>
    <App>
        <Switch>
            <Route path='/' exact component={Home}></Route>
            <Route path='/user' component={User}></Route>
            <Route path='/profile' component={Profile}></Route>
        </Switch>
    </App>
</Router>, window.root)